package com.pay.ioopos.fragment;


import com.pay.ioopos.BindState;
import com.pay.ioopos.StatusListener;

import static com.pay.ioopos.fragment.TipFragment.TipType.WAIT;

public class ShopShiftFragment extends TipVerticalFragment implements BindState {
    private StatusListener listener;
    private String staffId;
    public ShopShiftFragment(String staffId, StatusListener listener) {
        super(WAIT, "正在切换店员");
        this.staffId = staffId;
        this.listener = listener;
    }

    @Override
    public boolean useNetwork() {
        return true;
    }

    @Override
    public void execute() throws Exception {
        onSuccess("模拟测试");
    }

    @Override
    public void onError(String msg) {
        listener.onError(msg);
        speak("店员切换失败");
    }

    private void onSuccess(String staffName) {
        listener.onSuccess("切换店员：" + staffName);
        speak("店员切换成功");
    }

}
